package com.sailfish.springbootdemo.dao.db4;

import com.sailfish.springbootdemo.common.DB1TableName;
import com.sailfish.springbootdemo.common.DB4TableName;
import com.sailfish.springbootdemo.pojo.db4.TimerConfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

public interface TimerConfigDao {

    /**
     * 查询类型查询
     *
     * @return
     */
    @Results(id = "timerConfigResultMap", value = {
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.DATETIMEOFFSET),
            @Result(column = "update_time", property = "updateTime", jdbcType = JdbcType.DATETIMEOFFSET),
    })
    @Select("select * from " + DB4TableName.TIMER_CONFIG + " where type = #{type} limit 1")
    TimerConfig getTimerConfigByType(@Param("type")String type);
}
